package com.drotposta.unitils.impl;

import com.drotposta.unitils.*;
import java.security.Identity;
import java.security.Principal;
import java.util.Properties;
import javax.ejb.EJBHome;
import javax.ejb.EJBLocalHome;
import javax.ejb.EJBLocalObject;
import javax.ejb.EJBObject;
import javax.ejb.SessionContext;
import javax.ejb.TimerService;
import javax.transaction.UserTransaction;
import javax.xml.rpc.handler.MessageContext;

public class SessionContextImpl implements SessionContext {

    private boolean rollbackOnly = false;
    private Directory directory;

    public SessionContextImpl(Directory directory) {
        this.directory = directory;
    }
    

    public EJBLocalObject getEJBLocalObject() throws IllegalStateException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public EJBObject getEJBObject() throws IllegalStateException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public MessageContext getMessageContext() throws IllegalStateException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public <T> T getBusinessObject(Class<T> arg0) throws IllegalStateException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public Class getInvokedBusinessInterface() throws IllegalStateException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public EJBHome getEJBHome() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public EJBLocalHome getEJBLocalHome() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public Properties getEnvironment() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public Identity getCallerIdentity() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public Principal getCallerPrincipal() {
        return directory.getPrincipal();
    }

    public boolean isCallerInRole(Identity arg0) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean isCallerInRole(String arg0) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public UserTransaction getUserTransaction() throws IllegalStateException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setRollbackOnly() throws IllegalStateException {
        rollbackOnly = true;
    }
    
    public void resetRollbackOnly() throws IllegalStateException {
        rollbackOnly = false;
    }

    public boolean getRollbackOnly() throws IllegalStateException {
        return rollbackOnly;
    }

    public TimerService getTimerService() throws IllegalStateException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public Object lookup(String arg0) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean isRollbackOnly() {
        return rollbackOnly;
    }

    public void setRollbackOnly(boolean rollbackOnly) {
        this.rollbackOnly = rollbackOnly;
    }
    
    
}
